package com.lm.common.security.exception;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lm.common.security.component.CustomOauth2ExceptionSerializer;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

/**
 * 自定义 OAuth2 Exception
 *
 * @author lm
 * @date 2019/4/25 10:03
 */
@JsonSerialize(using = CustomOauth2ExceptionSerializer.class)
public class CustomOauth2Exception extends OAuth2Exception {

    private String errorCode;

    public CustomOauth2Exception(String msg) {
        super(msg);
    }

    public CustomOauth2Exception(String msg, String errorCode) {
        super(msg);
        this.errorCode = errorCode;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

}